<template>
  <svg :class="svgClass" aria-hidden="true">
    <use :xlink:href="iconName" :fill="color"></use>
  </svg>
</template>

<script setup>
const props = defineProps({
  iconClass:{
    type:String,
  },
  className:{
    type:String,
    default: ''
  },
  color:{
    type: String,
    default: ''
  }
})
const iconName = computed(()=>`#icon-${props.iconClass}`)
const svgClass = computed(()=>{
  if (props.iconClass){
    return `svg-icon icon-${props.iconClass}`
  }
  return 'svg-icon'
})
</script>

<style lang="scss" scoped>
.svg-icon{
  width:22px;
  height: 22px;
  vertical-align: center;
  fill: currentColor;
  overflow: hidden;
}
</style>